package co.edu.ucatolica.sislab.domainlist;

import java.util.List;

import co.edu.ucatolica.sislab.domainlist.domain.DomainListItemBean;
import co.edu.ucatolica.sislab.persistence.DatabaseException;
import co.edu.ucatolica.sislab.persistence.dao.DomainListPersistorHelper;
import co.edu.ucatolica.sislab.persistence.dto.DomainListItemDTO;

public class DomainListService {

	public static List<DomainListItemBean> getDomainList(Long transactionNumber, String domainListName) throws DatabaseException {
		Long idDomainList = DomainListPersistorHelper.getDomainListIdByName(transactionNumber, domainListName);
		List<DomainListItemDTO> domainListItemDTOs = DomainListPersistorHelper.getDomainListItemsByIdDomainList(transactionNumber, idDomainList);
		return DomainListUtils.listDTOToListDomainItemsListBean(domainListItemDTOs);
	}

}
